import json

class JsonDealer():
    
    file_location = "data.json"

    @staticmethod
    def writeData(data):
        with open(JsonDealer.file_location, 'w', encoding="utf-8") as outfile:
            json.dump(data, outfile, indent=2, ensure_ascii=False)


    @staticmethod
    def readData():
        try:
            with open(JsonDealer.file_location, 'r', encoding="utf-8") as json_file:
                return json.load(json_file)
        except:
            JsonDealer.writeData({})
            return JsonDealer.readData()
        